using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sedna.Core.Controls.Support;
using Sedna.Core.Tiles.Contents;

namespace Sedna.Core.Controls
{
	public class TabHeader : WebControl, IContent
	{
		public TabHeader()
		{
		}

		private String contentPlaceHolderId;

		public String ContentPlaceHolderId
		{
			get { return contentPlaceHolderId;}
			set { contentPlaceHolderId = value;}
		}

		protected override void OnPreRender(EventArgs e)
		{
			Build(this);
			base.OnPreRender(e);
		}

		private void Build(Control parent)
		{
			IPageWithTabHeader pageWithTabHeader = parent.Page as IPageWithTabHeader;
			if(pageWithTabHeader == null)
			{
				return;
			}
			
			parent.Controls.Add(new System.Web.UI.LiteralControl(pageWithTabHeader.TabHeaderLabel));
		}

	}
}
